<template>
  <div class="member-base">
    <router-view />
    <div v-if="$route.meta.footer.show" class="common-footer-wrap">
      <mt-tabbar v-model="home_selected" fixed class="common-footer">
        <mt-tab-item class="item-wrap" :class="{'active':$route.name=='HomeIndex'}" id="home_index">
          <router-link :to="{ name: 'HomeIndex'}" class="item">
            <img
              :src="this.$route.name == 'HomeIndex'? require('../../assets/image/index_2.png') : require('../../assets/image/index_1.png')"
              alt
            />
            <br />
            <span class="text">首页</span>
          </router-link>
        </mt-tab-item>
        <!--                <mt-tab-item class='item-wrap' :class="{'active':$route.name=='HomeGoodsclass'}" id='home_goodsclass'><router-link :to="{ name: 'HomeGoodsclass'}" class='item'><i class="iconfont icon-fenlei" /><span class='text'>分类</span></router-link></mt-tab-item>-->
        <mt-tab-item
          class="item-wrap"
          :class="{'active':$route.name=='HomeInformation'}"
          id="home_goodsclass"
        >
          <router-link :to="{ name: 'HomeInformation'}" class="item">
            <img
              :src="this.$route.name == 'HomeInformation'? require('../../assets/image/information_2.png') : require('../../assets/image/information_1.png')"
              alt
            />
            <br />
            <span class="text">资讯</span>
          </router-link>
        </mt-tab-item>
        <!--                <mt-tab-item class='item-wrap' :class="{'active':$route.name=='HomeSearch'}" id='home_search'><router-link :to="{ name: 'HomeSearch'}" class='item'><i class="iconfont icon-sousuo1" /><span class='text'>搜索</span></router-link></mt-tab-item>-->
        <mt-tab-item
          class="item-wrap"
          :class="{'active':$route.name=='HomeStorage'}"
          id="home_search"
        >
          <div class="item" @click="notice">
            <img
              :src="$route.name == 'HomeStorage'? require('../../assets/image/storage_2.png') : require('../../assets/image/storage_1.png')"
              alt
            />
            <br />
            <span class="text">仓储</span>
          </div>
        </mt-tab-item>
        <mt-tab-item class="item-wrap" :class="{'active':$route.name=='HomeCart'}" id="home_cart">
          <router-link :to="{ name: 'HomeCart'}" class="item">
            <img
              :src="this.$route.name == 'HomeCart'? require('../../assets/image/cart_2.png') : require('../../assets/image/cart_1.png')"
              alt
            />
            <br />
            <span class="text">购物车</span>
          </router-link>
        </mt-tab-item>
        <mt-tab-item
          class="item-wrap"
          :class="{'active':$route.name=='MemberIndex'}"
          id="member_index"
        >
          <router-link :to="{ name: 'MemberIndex'}" class="item">
            <img
              style="margin-bottom:0.2rem"
              :src="this.$route.name == 'MemberIndex'? require('../../assets/image/member_index_2.png') : require('../../assets/image/member_index_1.png')"
              alt
            />
            <br />
            <span class="text">我的</span>
          </router-link>
        </mt-tab-item>

        <!-- <mt-tab-item class='item-wrap' :class="{'active':$route.name=='HomeIndex'}" id='home_index'><router-link :to="{ name: 'HomeIndex'}" class='item'><i class='iconfont icon-homepage' /><span class='text'>首页</span></router-link></mt-tab-item> -->
        <!--                <mt-tab-item class='item-wrap' :class="{'active':$route.name=='HomeGoodsclass'}" id='home_goodsclass'><router-link :to="{ name: 'HomeGoodsclass'}" class='item'><i class="iconfont icon-fenlei" /><span class='text'>分类</span></router-link></mt-tab-item>-->
        <!-- <mt-tab-item class='item-wrap' :class="{'active':$route.name=='HomeInformation'}" id='home_goodsclass'><router-link :to="{ name: 'HomeInformation'}" class='item'><i class="iconfont icon-31chanpincanshu" /><span class='text'>资讯</span></router-link></mt-tab-item> -->
        <!--                <mt-tab-item class='item-wrap' :class="{'active':$route.name=='HomeSearch'}" id='home_search'><router-link :to="{ name: 'HomeSearch'}" class='item'><i class="iconfont icon-sousuo1" /><span class='text'>搜索</span></router-link></mt-tab-item>-->
        <!-- <mt-tab-item class='item-wrap' :class="{'active':$route.name=='HomeStorage'}" id='home_search' ><div class="item" @click="notice"><i class="iconfont icon-youhuiquan" /><span class='text'>仓储</span></div></mt-tab-item> -->
        <!--                <mt-tab-item class='item-wrap' :class="{'active':$route.name=='HomeGoodsclass'}" id='home_goodsclass'><router-link :to="{ name: 'HomeGoodsclass'}" class='item'><i class="iconfont icon-fenlei" /><span class='text'>分类</span></router-link></mt-tab-item>-->
        <!--                <mt-tab-item class='item-wrap' :class="{'active':$route.name=='HomeSearch'}" id='home_search'><router-link :to="{ name: 'HomeSearch'}" class='item'><i class="iconfont icon-sousuo1" /><span class='text'>搜索</span></router-link></mt-tab-item>-->
        <!-- <mt-tab-item class='item-wrap' :class="{'active':$route.name=='HomeCart'}" id='home_cart'><router-link :to="{ name: 'HomeCart'}" class='item'><i class='iconfont icon-31gouwuche' /><span class='text'>购物车</span></router-link></mt-tab-item> -->
        <!-- <mt-tab-item class='item-wrap' :class="{'active':$route.name=='MemberIndex'}" id='member_index'><router-link :to="{ name: 'MemberIndex'}" class='item'><i class='iconfont icon-people' /><span class='text'>我的</span></router-link></mt-tab-item> -->
      </mt-tabbar>
    </div>
  </div>
</template>

<script>
import { Toast } from "mint-ui";
import { mapState } from "vuex";
export default {
  name: "MemberBase",
  data() {
    return {
      home_selected: "member_index",
    };
  },
  computed: {
    ...mapState({
      user: (state) => state.member.info,
    }),
  },
  created: function () {
    if (!this.user) {
      this.$router.push({ name: "HomeMemberLogin" });
    }
  },
  methods: {
    notice() {
      // Toast('敬请期待！')
      this.$router.push({ name: "HomeStorage" });
    },
  },
};
</script>
<style lang="scss" scoped>
.home-base {
  width: 100vw;
  height: 100vh;
  background: #ffffff;
}
div.item img {
  margin: 0.27rem 0;
}
img {
  width: 1.2rem;
  margin-top: 0.1rem;
  margin-bottom: 0.15rem;
  // hei;
}
// .common-footer-wrap .common-footer{
//     background-color: red;
// }
</style>

